%%读取数据集

clear;
close all;
tic;
for j = 1
   
   load(['data\cifar-10-batches-mat\data_batch_' num2str(j) '.mat'])
    for i=1:100
        p=data(i,:);
        label=labels(i);

        fig=zeros(32,32,3);
        fig(:,:,1)=reshape(p(1:1024),32,32)';
        fig(:,:,2)=reshape(p(1025:2048),32,32)';
        fig(:,:,3)=reshape(p(2049:end),32,32)';


        imwrite(fig/256,['C:\Users\77026\Desktop\ms\lab3\code\Feature_extraction\image/batch_' num2str(j) '_label_' num2str(label) '_' num2str(i)  '.png'])
    end
end
toc;






